

<%@ page import="sedh.project.User" %>
<html>
    <head>
        <g:render template="/header"/>
    </head>
    <body>
        <g:render template="/informationBar"/>
    
        <g:render template="/menu"/>
        <div class="body">
            <h1>Editar Usuario</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${userInstance}">
            <div class="errors">
                <g:renderErrors bean="${userInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${userInstance?.id}" />
                <g:hiddenField name="version" value="${userInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
							<td valign="top" class="name"><label for="nome"><g:message
										code="user.nome.label" default="Nome:" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'nome', 'errors')}">
								<g:textField name="nome" maxlength="30"
									value="${userInstance?.nome}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="municipio"><g:message
										code="user.municipio.label" default="Municipio:" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'municipio', 'errors')}">
								<g:textField name="municipio"
									value="${fieldValue(bean: userInstance, field: 'municipio')}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="papel"><g:message
										code="user.papel.label" default="Papel:" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'papel', 'errors')}">
								<g:select id="papelSelection" name="papel"
									from="${sedhproject.Papel}" value=""
									noSelection="['':'Selecionar...']" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="telefone"><g:message
										code="user.telefone.label" default="Telefone:" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'telefone', 'errors')}">
								<g:textField name="telefone"
									value="${fieldValue(bean: userInstance, field: 'telefone')}" />
							</td>
						</tr>

						<tr class="prop">
							<td valign="top" class="name"><label for="email"><g:message
										code="user.email.label" default="Email" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'email', 'errors')}">
								<g:textField name="email"
									value="${userInstance?.email}" />
							</td>
						</tr>
						
						<tr class="prop">
							<td valign="top" class="name"><label for="rg"><g:message
										code="user.rg.label" default="Rg:" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'rg', 'errors')}">
								<g:textField name="rg"
									value="${userInstance?.rg}" />
								<br></br>
							</td>
							
						</tr>
						
						<tr class="prop">
							<td valign="top" class="name"><label for="password"><g:message
										code="user.password.label" default="Sua senha:" /> </label>
							</td>
							<td valign="top"
								class="value ${hasErrors(bean: userInstance, field: 'password', 'errors')}">
								<g:passwordField name="password"
									value="${userInstance?.password}" />
							</td>
							
						</tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Atualizar')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Deletar')}" onclick="return confirm('Voce tem certeza?');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>